package com.xlhl.init.model.vo.login;

import cn.hutool.core.bean.BeanUtil;
import com.xlhl.init.model.entity.Account;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Map;

/**
 * @author xlhl
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AccountLoginInfo implements Serializable {
    @Serial
    private static final long serialVersionUID = -7238880001318077803L;

    /**
     * ID
     */
    private Long id;

    /**
     * 昵称
     */
    private String nickname;

    /**
     * 头像
     */
    private String avatar;

    /**
     * 权限
     * <p>这样写，前端就可以直接使用 permissions[fatherId] 获取到对应位图，就不麻烦了</p>
     * key->fatherId value->对应权限位图
     * {key: fatherId, value: permission}
     */
    private Map<Long, Long> permissions;

    public AccountLoginInfo(Account account) {
        BeanUtil.copyProperties(account, this);
    }
}













